package com.yanmaohu.yulia.bean;

/**
 * @author Bright Lee
 */
public final class SimilarPredicatePart2 implements WhenOperand {

    private int beginIndex;
    private int endIndex;
    private boolean not;
    private StringValueExpression similarPattern;
    private EscapeCharacter escapeCharacter;

    public SimilarPredicatePart2(int beginIndex,
                                 boolean not,
                                 StringValueExpression similarPattern,
                                 EscapeCharacter escapeCharacter) {
        this.beginIndex = beginIndex;
        this.endIndex = escapeCharacter != null ? escapeCharacter.getEndIndex() : similarPattern.getEndIndex();
        this.not = not;
        this.similarPattern = similarPattern;
        this.escapeCharacter = escapeCharacter;
    }

    public int getBeginIndex() {
        return beginIndex;
    }

    public int getEndIndex() {
        return endIndex;
    }

    public boolean isNot() {
        return not;
    }

    public StringValueExpression getSimilarPattern() {
        return similarPattern;
    }

    public EscapeCharacter getEscapeCharacter() {
        return escapeCharacter;
    }

}
